<?php class Zen_Theme {
	
	private static $_name = 'default';
	
	public static function getName() {
		return self::$_name;
	}
	
	public static function setName($name) {
		if (! $name) return ;
		self::$_name = $name;
	}
	
	public function getList() {
		$path = ROOT_PATH . "/site/themes/";
		$layouts = scandir ( $path );
		$res = array ();
		foreach ( $layouts as $layout ) {
			if ((! preg_match ( '/^\./', $layout )) && (! preg_match ( '/^default\./', $layout ))) {
				$name = preg_replace ( '/\.\S+$/', '', $layout );
				$res [$name] = $layout;
			}
		}
		return $res;
	}
	
	public static function _($url) {
		$theme = self::getName();
	    $baseURL = "/site/themes/{$theme}"; 
	    return $baseURL . $url;
	}
	
}